home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Tools / SFX-Player / Mpeg / MrMPEG / Play.rexx < prev    next >
OS/2 REXX Batch file  |  2000-05-08  |  2KB  |  66 lines

  1. /* Play.rexx */
  2.  
  3. options results; address MrMPEG
  4.  
  5. MUIA_Disabled        = 0x80423661;    MUIA_Selected        = 0x8042654b
  6. MUIA_List_Entries    = 0x80421654;    MUIA_List_Active    = 0x8042391c
  7. MUIA_NoNotify        = 0x804237f9;    MUIA_Slider_Level    = 0x8042ae3a
  8. MUIV_List_Active_Down    = -5;        MUIV_List_Active_Top    = -2
  9.  
  10. getvar stopped
  11. if result = 1 then return
  12. check ID PLAY; playing = result
  13. if playing = 1 then do
  14.   do forever
  15.     check ID PLAY ATTRS MUIA_Disabled 1
  16.     setvar cont 0
  17.     list ID SLIST ATTRS MUIA_List_Entries
  18.     if result = 0 then call Insert.rexx
  19.     call PlayMain()
  20.     getvar cont
  21.     if result = 1 then iterate
  22.     check ID PLAY; playing = result
  23.     cycle ID REPT; repeat = result
  24.     if playing = 1 & repeat == 'Repeat All' then do
  25.       list ID SLIST ATTRS MUIA_List_Entries; max = result
  26.       if max = 0 then leave
  27.       list ID SLIST ATTRS MUIA_List_Active; current = result
  28.       list ID SLIST POS current; parse var result filename','dummy
  29.       getvar current_song; temp_song = result
  30.       if filename = temp_song & max ~= 1 then do
  31.         check ID RAND; rnd = result
  32.         if rnd = 1 then do
  33.           flag = 0
  34.           do while flag = 0
  35.             temp = random(0, max - 1, time('S'))
  36.             if temp ~= current then do
  37.               list ID SLIST ATTRS MUIA_List_Active temp
  38.               flag = 1
  39.             end
  40.           end /* of while flag */
  41.         end /* of if rnd */
  42.         else if current ~= max - 1 then list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Down
  43.         else list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Top
  44.       end /* of if filename */
  45.       else do /* current song ~= selected song */
  46.         slider ID PROG ATTRS MUIA_Slider_Level 0
  47.         setvar current_time '00:00'
  48.         /* text ID CURNT LABEL "\033b\033r00:00" */
  49.       end
  50.       iterate
  51.     end /* of if playing */
  52.     else if playing = 1 & repeat == 'Repeat 1' then do
  53.       slider ID PROG ATTRS MUIA_Slider_Level 0
  54.       setvar current_time '00:00'
  55.       /* text ID CURNT LABEL "\033b\033r00:00" */
  56.       iterate
  57.     end
  58.     else leave    /* no repeat */
  59.   end /* of do forever */
  60. end /* of if playing */
  61. check ID PLAY ATTRS MUIA_Selected 0 MUIA_NoNotify 1
  62. call setclip('MrMPEG_FLAG', 1)
  63. address command 'Kill >NIL: MPEGA'
  64. setvar stopped 0
  65. return
  66.